package com.simple.common.enumdto;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * @ClassName BankType
 * @Author SimpleTree
 **/
@Getter
@AllArgsConstructor
public enum  BankType {
    boc(1, "中国银行"),
    abc(2,"中国农业银行"),
    ccb(3,"中国建设银行"),
    icbc(4,"中国工商银行"),
    bcm(5,"中国交通银行"),
    psbc(6,"中国邮政银行"),
    cbm  (7,"中国招商银行"),
    cib  (8,"兴业银行"),
    bogz (9,"广州银行"),
    other(99,"其他银行")

    ;
    private Integer code;
    private String msg;

    public static String getMsg(Integer code) {
        return Arrays.stream(BankType.values()).filter(bankType -> code.equals(bankType.getCode())).findFirst().map(BankType::getMsg).orElse("未知异常");
    }
}
